namespace Home.Domain.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class _424 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.PArticle",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Title = c.String(nullable: false, maxLength: 60),
                        Sort = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            AddColumn("dbo.Article", "Path", c => c.String(nullable: false, maxLength: 60));
            AddColumn("dbo.Article", "PArticleId", c => c.Int(nullable: false));
            AlterColumn("dbo.Article", "Sort", c => c.Int(nullable: false));
            AddForeignKey("dbo.Article", "PArticleId", "dbo.PArticle", "Id", cascadeDelete: true);
            CreateIndex("dbo.Article", "PArticleId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Article", new[] { "PArticleId" });
            DropForeignKey("dbo.Article", "PArticleId", "dbo.PArticle");
            AlterColumn("dbo.Article", "Sort", c => c.Single(nullable: false));
            DropColumn("dbo.Article", "PArticleId");
            DropColumn("dbo.Article", "Path");
            DropTable("dbo.PArticle");
        }
    }
}
